import request from '@/utils/request'


export function getBranch(parentId) {
  return request({
    url: `/api/security/branch?parentId=${parentId}`, 
    method: 'get'
  })
}

export function getBranchId(branchId) {
  return request({
    url: `/api/security/branch/${branchId}`, 
    method: 'get'
  })
}

export function postBranch(data) {
  return request({
    url: '/api/security/branch', 
    method: 'post',
    data
  })
}

export function deleteBranch(branchId) {
  return request({
    url: `/api/security/branch/${branchId}`,
    method: 'delete'
  })
}

export function putBranch(branchId,data) {
  return request({
    url: `/api/security/branch/${branchId}`,
    method: 'put',
    data
  })
}